﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Koonsoft.CustomerService.DAL;
using Koonsoft.CustomerService.Entity;

namespace Koonsoft.CustomerService.BLL
{
    public class IssueAccessoriesBLL
    {
        private IssueAccessoriesDAL _dal = null;

        protected IssueAccessoriesDAL DAL
        {
            get
            {
                if (_dal == null)
                {
                    _dal = new IssueAccessoriesDAL();
                }

                return _dal;
            }
        }

        public bool Create(IssueAccessorie acc, out string msg)
        {
            return DAL.Create(acc, out msg);
        }

        public void Create(List<IssueAccessorie> accessories)
        {
            string msg;
            if (accessories != null)
            {
                foreach (var v in accessories)
                {
                    Create(v, out msg);
                }
            }
        }

        public List<IssueAccessorie> GetIssueAccessorie(Guid guid, out string msg)
        {
            return DAL.GetIssueAccessorie(guid,out msg);
        }

    }
}
